import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            int m = b;
            int n = a;
            int t = 0;
            if (a < b) {
                t = a;
                a = b;
                b = t;
            }
            int k = 0;
            while (b != 0) {
                k = a % b;
                a = b;
                b = k;
            }
            System.out.println(a + " " + m * n / a);

        }
    }
}